import request from '@/utils/request'

//获取分类列表
export function findAll() {
  return request({
    url: 'articleContent/findAll',
    method: 'get'
  })
}


//根据id获取
export function findById(id) {
  return request({
    url: 'articleContent/findById',
    method: 'get',
    params: {
      id: id
    }
  })
}
//根据parentId获取
export function findByparentIdType(parentId,type) {
  return request({
    url: 'articleContent/findByparentIdType',
    method: 'get',
    params: {
      parentId: parentId,
      type:type
    }
  })
}

//删除
export function deleteContent(id) {
  return request({
    url: 'articleContent/delete',
    method: 'get',
    params: {
      id: id
    }
  })
}

//修改
export function updateContent(articleContent) {
  return request({
    url: 'articleContent/update',
    method: 'post',
    data: articleContent
  })
}

//插入
export function insertContent(articleContent) {
  return request({
    url: 'articleContent/insert',
    method: 'post',
    data: articleContent
  })
}

export function updateArticleContentSort(sort,id){
  return request({
    url: 'articleContent/updateSort',
    method: 'get',
    params: {
      sort: sort,
      id:id
    }
  })
}
